function addjzxx(gx,xm,zzmm,hyzk,lxdh,dzyj,zy,gzdw){
	var gx_bak = document.getElementById(gx).value;
	var xm_bak = document.getElementById(xm).value;
	var zzmm_bak = document.getElementById(zzmm).value;
	var hyzk_bak = document.getElementById(hyzk).value;
	var lxdh_bak = document.getElementById(lxdh).value;
	var dzyj_bak = document.getElementById(dzyj).value;
	var zy_bak = document.getElementById(zy).value;
	var gzdw_bak = document.getElementById(gzdw).value;
	
	if(gx_bak==""){alert('关系不能为空');return false;}
	else if(xm_bak==""){alert('家长姓名不能为空');return false;}
	else if(hyzk_bak==""){alert('婚姻状况不能为空');return false;}
	else if(lxdh_bak==""){alert('联系电话不能为空');return false;}
	
	else {addRow(gx_bak,xm_bak,zzmm_bak,hyzk_bak,lxdh_bak,dzyj_bak,zy_bak,gzdw_bak);}
	closelistDiv('jzxx');
	document.getElementById(gx).value = '';
	document.getElementById(xm).value = '';
	document.getElementById(zzmm).value = '';
	document.getElementById(hyzk).value = '';
	document.getElementById(lxdh).value = '';
	document.getElementById(dzyj).value = '';
	document.getElementById(zy).value = '';
	document.getElementById(gzdw).value = '';
	//alert(document.getElementById("dzyj").value);
	}
	
function addRow(gx,xm,zzmm,hyzk,lxdh,dzyj,zy,gzdw){ 
	var newTr =document.getElementById("mainTbody").insertRow(-1); 
	newTr.className = "tronMouseout";
	var td_1 = newTr.insertCell(0); 
	var td_2 = newTr.insertCell(1); 
	var td_3 = newTr.insertCell(2);
	var td_4 = newTr.insertCell(3);
	var td_5 = newTr.insertCell(4); 
	var td_6 = newTr.insertCell(5); 
	var td_7 = newTr.insertCell(6);
	var td_8 = newTr.insertCell(7);
	
	td_1.align = td_2.align = td_3.align = td_4.align = td_5.align = td_6.align = td_7.align = td_8.align = "center";
	td_8.className = "rightButBak";
	
	td_1.innerHTML = "<input type='hidden' name='zy_bak' value = '"+zy+"'><input type='hidden' name='gzdw_bak' value = '"+gzdw+"'>";
	td_2.innerHTML = gx+"<input type='hidden' name='gx_bak' value = '"+gx+"'>"; 
	td_3.innerHTML = xm+"<input type='hidden' name='xm_bak' value = '"+xm+"'>";
	td_4.innerHTML = zzmm+"<input type='hidden' name='zzmm_bak' value = '"+zzmm+"'>";
	td_5.innerHTML = hyzk+"<input type='hidden' name='hyzk_bak' value = '"+hyzk+"'>";
	td_6.innerHTML = lxdh+"<input type='hidden' name='lxdh_bak' value = '"+lxdh+"'>"; 
	td_7.innerHTML = dzyj+"<input type='hidden' name='dzyj_bak' value = '"+dzyj+"'>";
	td_8.innerHTML = "<a onclick=\"upjzxx(this,'"+gx+"','"+xm+"','"+zzmm+"','"+hyzk+"','"+lxdh+"','"+dzyj+"','"+zy+"','"+gzdw+"')\">修改</a><a onclick=\"delRow(this)\">删除</a>";
	
	
	}

function delRow(obj){
	var i = obj.parentNode.parentNode.rowIndex; 
	obj.parentNode.parentNode.parentNode.parentNode.deleteRow(i);
	}

function upjzxx(obj,gx,xm,zzmm,hyzk,lxdh,dzyj,zy,gzdw){
	//alert(zy);
	addListGroup('jzxxxg');
	document.getElementById("xg_gx").value = gx;
	document.getElementById("xg_xm").value = xm;
	document.getElementById("xg_zzmm").value = zzmm;
	document.getElementById("xg_hyzk").value = hyzk;
	document.getElementById("xg_lxdh").value = lxdh;
	document.getElementById("xg_dzyj").value = dzyj;
	document.getElementById("xg_zy").value = zy;
	document.getElementById("xg_gzdw").value = gzdw;
	document.getElementById("rowsindex").value = obj.parentNode.parentNode.rowIndex;
	}

function upAndAddjzxx(gx,xm,zzmm,hyzk,lxdh,dzyj,zy,gzdw){
	var rowsindex_bak = document.getElementById("rowsindex").value;
	document.getElementById("mainTbody").deleteRow(rowsindex_bak);
	var gx_bak = document.getElementById(gx).value;
	var xm_bak = document.getElementById(xm).value;
	var zzmm_bak = document.getElementById(zzmm).value;
	var hyzk_bak = document.getElementById(hyzk).value;
	var lxdh_bak = document.getElementById(lxdh).value;
	var dzyj_bak = document.getElementById(dzyj).value;
	var zy_bak = document.getElementById(zy).value;
	var gzdw_bak = document.getElementById(gzdw).value;
	
	if(xm_bak==""){alert('家长姓名不能为空');return false;}
	else if(lxdh_bak==""){alert('联系电话不能为空');return false;}
	
	else {addRow(gx_bak,xm_bak,zzmm_bak,hyzk_bak,lxdh_bak,dzyj_bak,zy_bak,gzdw_bak);}
	
	closelistDiv('jzxxxg');
	}